package com.szyt.basicframe.annotation;

import com.szyt.basicframe.common.OperationTypeEnum;
import com.szyt.basicframe.handler.UserNameUniqueValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

@Documented
@Constraint(validatedBy = UserNameUniqueValidator.class)
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface UserNameUnique {
    String message() default "用户名已存在";
    OperationTypeEnum type();
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}